//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension OSIS {
    // MARK: Enums

    public enum ChangeProgressStageStatuses: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case completed = "COMPLETED"
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum ChangeProgressStatuses: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case completed = "COMPLETED"
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        case pending = "PENDING"
        public var description: String { return self.rawValue }
    }

    public enum PipelineEndpointStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case active = "ACTIVE"
        case createFailed = "CREATE_FAILED"
        case creating = "CREATING"
        case deleting = "DELETING"
        case revoked = "REVOKED"
        case revoking = "REVOKING"
        public var description: String { return self.rawValue }
    }

    public enum PipelineStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case active = "ACTIVE"
        case createFailed = "CREATE_FAILED"
        case creating = "CREATING"
        case deleting = "DELETING"
        case startFailed = "START_FAILED"
        case starting = "STARTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        case updateFailed = "UPDATE_FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum VpcEndpointManagement: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case customer = "CUSTOMER"
        case service = "SERVICE"
        public var description: String { return self.rawValue }
    }

    public enum VpcEndpointServiceName: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case opensearchServerless = "OPENSEARCH_SERVERLESS"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct BufferOptions: AWSEncodableShape & AWSDecodableShape {
        /// Whether persistent buffering should be enabled.
        public let persistentBufferEnabled: Bool

        @inlinable
        public init(persistentBufferEnabled: Bool) {
            self.persistentBufferEnabled = persistentBufferEnabled
        }

        private enum CodingKeys: String, CodingKey {
            case persistentBufferEnabled = "PersistentBufferEnabled"
        }
    }

    public struct ChangeProgressStage: AWSDecodableShape {
        /// A description of the stage.
        public let description: String?
        /// The most recent updated timestamp of the stage.
        public let lastUpdatedAt: Date?
        /// The name of the stage.
        public let name: String?
        /// The current status of the stage that the change is in.
        public let status: ChangeProgressStageStatuses?

        @inlinable
        public init(description: String? = nil, lastUpdatedAt: Date? = nil, name: String? = nil, status: ChangeProgressStageStatuses? = nil) {
            self.description = description
            self.lastUpdatedAt = lastUpdatedAt
            self.name = name
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case lastUpdatedAt = "LastUpdatedAt"
            case name = "Name"
            case status = "Status"
        }
    }

    public struct ChangeProgressStatus: AWSDecodableShape {
        /// Information about the stages that the pipeline is going through to perform the configuration change.
        public let changeProgressStages: [ChangeProgressStage]?
        /// The time at which the configuration change is made on the pipeline.
        public let startTime: Date?
        /// The overall status of the pipeline configuration change.
        public let status: ChangeProgressStatuses?
        /// The total number of stages required for the pipeline configuration change.
        public let totalNumberOfStages: Int?

        @inlinable
        public init(changeProgressStages: [ChangeProgressStage]? = nil, startTime: Date? = nil, status: ChangeProgressStatuses? = nil, totalNumberOfStages: Int? = nil) {
            self.changeProgressStages = changeProgressStages
            self.startTime = startTime
            self.status = status
            self.totalNumberOfStages = totalNumberOfStages
        }

        private enum CodingKeys: String, CodingKey {
            case changeProgressStages = "ChangeProgressStages"
            case startTime = "StartTime"
            case status = "Status"
            case totalNumberOfStages = "TotalNumberOfStages"
        }
    }

    public struct CloudWatchLogDestination: AWSEncodableShape & AWSDecodableShape {
        /// The name of the CloudWatch Logs group to send pipeline logs to. You can specify an existing log group or create a new one. For example, /aws/vendedlogs/OpenSearchService/pipelines.
        public let logGroup: String

        @inlinable
        public init(logGroup: String) {
            self.logGroup = logGroup
        }

        public func validate(name: String) throws {
            try self.validate(self.logGroup, name: "logGroup", parent: name, max: 512)
            try self.validate(self.logGroup, name: "logGroup", parent: name, min: 1)
            try self.validate(self.logGroup, name: "logGroup", parent: name, pattern: "^\\/aws\\/vendedlogs\\/[\\.\\-_/#A-Za-z0-9]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case logGroup = "LogGroup"
        }
    }

    public struct CreatePipelineEndpointRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pipeline to create the endpoint for.
        public let pipelineArn: String
        /// Container for the VPC configuration for the pipeline endpoint, including subnet IDs and security group IDs.
        public let vpcOptions: PipelineEndpointVpcOptions

        @inlinable
        public init(pipelineArn: String, vpcOptions: PipelineEndpointVpcOptions) {
            self.pipelineArn = pipelineArn
            self.vpcOptions = vpcOptions
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, max: 76)
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, min: 46)
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
            try self.vpcOptions.validate(name: "\(name).vpcOptions")
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineArn = "PipelineArn"
            case vpcOptions = "VpcOptions"
        }
    }

    public struct CreatePipelineEndpointResponse: AWSDecodableShape {
        /// The unique identifier of the pipeline endpoint.
        public let endpointId: String?
        /// The Amazon Resource Name (ARN) of the pipeline associated with the endpoint.
        public let pipelineArn: String?
        /// The current status of the pipeline endpoint.
        public let status: PipelineEndpointStatus?
        /// The ID of the VPC where the pipeline endpoint was created.
        public let vpcId: String?

        @inlinable
        public init(endpointId: String? = nil, pipelineArn: String? = nil, status: PipelineEndpointStatus? = nil, vpcId: String? = nil) {
            self.endpointId = endpointId
            self.pipelineArn = pipelineArn
            self.status = status
            self.vpcId = vpcId
        }

        private enum CodingKeys: String, CodingKey {
            case endpointId = "EndpointId"
            case pipelineArn = "PipelineArn"
            case status = "Status"
            case vpcId = "VpcId"
        }
    }

    public struct CreatePipelineRequest: AWSEncodableShape {
        /// Key-value pairs to configure persistent buffering for the pipeline.
        public let bufferOptions: BufferOptions?
        /// Key-value pairs to configure encryption for data that is written to a persistent buffer.
        public let encryptionAtRestOptions: EncryptionAtRestOptions?
        /// Key-value pairs to configure log publishing.
        public let logPublishingOptions: LogPublishingOptions?
        /// The maximum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let maxUnits: Int
        /// The minimum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let minUnits: Int
        /// The pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with \n.
        public let pipelineConfigurationBody: String
        /// The name of the OpenSearch Ingestion pipeline to create. Pipeline names are unique across the pipelines owned by an account within an Amazon Web Services Region.
        public let pipelineName: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants the pipeline permission to access Amazon Web Services resources.
        public let pipelineRoleArn: String?
        /// List of tags to add to the pipeline upon creation.
        public let tags: [Tag]?
        /// Container for the values required to configure VPC access for the pipeline. If you don't specify these values, OpenSearch Ingestion creates the pipeline with a public endpoint.
        public let vpcOptions: VpcOptions?

        @inlinable
        public init(bufferOptions: BufferOptions? = nil, encryptionAtRestOptions: EncryptionAtRestOptions? = nil, logPublishingOptions: LogPublishingOptions? = nil, maxUnits: Int, minUnits: Int, pipelineConfigurationBody: String, pipelineName: String, pipelineRoleArn: String? = nil, tags: [Tag]? = nil, vpcOptions: VpcOptions? = nil) {
            self.bufferOptions = bufferOptions
            self.encryptionAtRestOptions = encryptionAtRestOptions
            self.logPublishingOptions = logPublishingOptions
            self.maxUnits = maxUnits
            self.minUnits = minUnits
            self.pipelineConfigurationBody = pipelineConfigurationBody
            self.pipelineName = pipelineName
            self.pipelineRoleArn = pipelineRoleArn
            self.tags = tags
            self.vpcOptions = vpcOptions
        }

        public func validate(name: String) throws {
            try self.encryptionAtRestOptions?.validate(name: "\(name).encryptionAtRestOptions")
            try self.logPublishingOptions?.validate(name: "\(name).logPublishingOptions")
            try self.validate(self.maxUnits, name: "maxUnits", parent: name, min: 1)
            try self.validate(self.minUnits, name: "minUnits", parent: name, min: 1)
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, max: 24000)
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, max: 2048)
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, min: 20)
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b|aws\\-iso\\-e|aws\\-iso\\-f):iam::[0-9]+:role\\/.*$")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.vpcOptions?.validate(name: "\(name).vpcOptions")
        }

        private enum CodingKeys: String, CodingKey {
            case bufferOptions = "BufferOptions"
            case encryptionAtRestOptions = "EncryptionAtRestOptions"
            case logPublishingOptions = "LogPublishingOptions"
            case maxUnits = "MaxUnits"
            case minUnits = "MinUnits"
            case pipelineConfigurationBody = "PipelineConfigurationBody"
            case pipelineName = "PipelineName"
            case pipelineRoleArn = "PipelineRoleArn"
            case tags = "Tags"
            case vpcOptions = "VpcOptions"
        }
    }

    public struct CreatePipelineResponse: AWSDecodableShape {
        /// Container for information about the created pipeline.
        public let pipeline: Pipeline?

        @inlinable
        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline = "Pipeline"
        }
    }

    public struct DeletePipelineEndpointRequest: AWSEncodableShape {
        /// The unique identifier of the pipeline endpoint to delete.
        public let endpointId: String

        @inlinable
        public init(endpointId: String) {
            self.endpointId = endpointId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.endpointId, key: "EndpointId")
        }

        public func validate(name: String) throws {
            try self.validate(self.endpointId, name: "endpointId", parent: name, max: 512)
            try self.validate(self.endpointId, name: "endpointId", parent: name, min: 3)
            try self.validate(self.endpointId, name: "endpointId", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9-_]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeletePipelineEndpointResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeletePipelineRequest: AWSEncodableShape {
        /// The name of the pipeline to delete.
        public let pipelineName: String

        @inlinable
        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.pipelineName, key: "PipelineName")
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeletePipelineResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteResourcePolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource from which to delete the policy.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "ResourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 76)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 46)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteResourcePolicyResponse: AWSDecodableShape {
        public init() {}
    }

    public struct EncryptionAtRestOptions: AWSEncodableShape & AWSDecodableShape {
        /// The ARN of the KMS key used to encrypt buffer data. By default, data is encrypted using an Amazon Web Services owned key.
        public let kmsKeyArn: String

        @inlinable
        public init(kmsKeyArn: String) {
            self.kmsKeyArn = kmsKeyArn
        }

        public func validate(name: String) throws {
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, max: 2048)
            try self.validate(self.kmsKeyArn, name: "kmsKeyArn", parent: name, min: 7)
        }

        private enum CodingKeys: String, CodingKey {
            case kmsKeyArn = "KmsKeyArn"
        }
    }

    public struct GetPipelineBlueprintRequest: AWSEncodableShape {
        /// The name of the blueprint to retrieve.
        public let blueprintName: String
        /// The format format of the blueprint to retrieve.
        public let format: String?

        @inlinable
        public init(blueprintName: String, format: String? = nil) {
            self.blueprintName = blueprintName
            self.format = format
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.blueprintName, key: "BlueprintName")
            request.encodeQuery(self.format, key: "format")
        }

        public func validate(name: String) throws {
            try self.validate(self.format, name: "format", parent: name, pattern: "^(YAML|JSON)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetPipelineBlueprintResponse: AWSDecodableShape {
        /// The requested blueprint in YAML format.
        public let blueprint: PipelineBlueprint?
        /// The format of the blueprint.
        public let format: String?

        @inlinable
        public init(blueprint: PipelineBlueprint? = nil, format: String? = nil) {
            self.blueprint = blueprint
            self.format = format
        }

        private enum CodingKeys: String, CodingKey {
            case blueprint = "Blueprint"
            case format = "Format"
        }
    }

    public struct GetPipelineChangeProgressRequest: AWSEncodableShape {
        /// The name of the pipeline.
        public let pipelineName: String

        @inlinable
        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.pipelineName, key: "PipelineName")
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetPipelineChangeProgressResponse: AWSDecodableShape {
        /// The current status of the change happening on the pipeline.
        public let changeProgressStatuses: [ChangeProgressStatus]?

        @inlinable
        public init(changeProgressStatuses: [ChangeProgressStatus]? = nil) {
            self.changeProgressStatuses = changeProgressStatuses
        }

        private enum CodingKeys: String, CodingKey {
            case changeProgressStatuses = "ChangeProgressStatuses"
        }
    }

    public struct GetPipelineRequest: AWSEncodableShape {
        /// The name of the pipeline.
        public let pipelineName: String

        @inlinable
        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.pipelineName, key: "PipelineName")
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetPipelineResponse: AWSDecodableShape {
        /// Detailed information about the requested pipeline.
        public let pipeline: Pipeline?

        @inlinable
        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline = "Pipeline"
        }
    }

    public struct GetResourcePolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the resource for which to retrieve the policy.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "ResourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 76)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 46)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetResourcePolicyResponse: AWSDecodableShape {
        /// The resource-based policy document in JSON format.
        public let policy: String?
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String?

        @inlinable
        public init(policy: String? = nil, resourceArn: String? = nil) {
            self.policy = policy
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case policy = "Policy"
            case resourceArn = "ResourceArn"
        }
    }

    public struct ListPipelineBlueprintsRequest: AWSEncodableShape {
        public init() {}
    }

    public struct ListPipelineBlueprintsResponse: AWSDecodableShape {
        /// A list of available blueprints for Data Prepper.
        public let blueprints: [PipelineBlueprintSummary]?

        @inlinable
        public init(blueprints: [PipelineBlueprintSummary]? = nil) {
            self.blueprints = blueprints
        }

        private enum CodingKeys: String, CodingKey {
            case blueprints = "Blueprints"
        }
    }

    public struct ListPipelineEndpointConnectionsRequest: AWSEncodableShape {
        /// The maximum number of pipeline endpoint connections to return in the response.
        public let maxResults: Int?
        /// If your initial ListPipelineEndpointConnections operation returns a nextToken, you can include the returned nextToken in subsequent ListPipelineEndpointConnections operations, which returns results in the next page.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 3000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^([\\s\\S]*)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPipelineEndpointConnectionsResponse: AWSDecodableShape {
        /// When nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// A list of pipeline endpoint connections.
        public let pipelineEndpointConnections: [PipelineEndpointConnection]?

        @inlinable
        public init(nextToken: String? = nil, pipelineEndpointConnections: [PipelineEndpointConnection]? = nil) {
            self.nextToken = nextToken
            self.pipelineEndpointConnections = pipelineEndpointConnections
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pipelineEndpointConnections = "PipelineEndpointConnections"
        }
    }

    public struct ListPipelineEndpointsRequest: AWSEncodableShape {
        /// The maximum number of pipeline endpoints to return in the response.
        public let maxResults: Int?
        /// If your initial ListPipelineEndpoints operation returns a NextToken, you can include the returned NextToken in subsequent ListPipelineEndpoints operations, which returns results in the next page.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 3000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^([\\s\\S]*)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPipelineEndpointsResponse: AWSDecodableShape {
        /// When NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// A list of pipeline endpoints.
        public let pipelineEndpoints: [PipelineEndpoint]?

        @inlinable
        public init(nextToken: String? = nil, pipelineEndpoints: [PipelineEndpoint]? = nil) {
            self.nextToken = nextToken
            self.pipelineEndpoints = pipelineEndpoints
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pipelineEndpoints = "PipelineEndpoints"
        }
    }

    public struct ListPipelinesRequest: AWSEncodableShape {
        /// An optional parameter that specifies the maximum number of results to return. You can use nextToken to get the next page of results.
        public let maxResults: Int?
        /// If your initial ListPipelines operation returns a nextToken, you can include the returned nextToken in subsequent ListPipelines operations, which returns results in the next page.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 3000)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^([\\s\\S]*)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListPipelinesResponse: AWSDecodableShape {
        /// When nextToken is returned, there are more results available. The value of nextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
        public let nextToken: String?
        /// A list of all existing Data Prepper pipelines.
        public let pipelines: [PipelineSummary]?

        @inlinable
        public init(nextToken: String? = nil, pipelines: [PipelineSummary]? = nil) {
            self.nextToken = nextToken
            self.pipelines = pipelines
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pipelines = "Pipelines"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pipeline to retrieve tags for.
        public let arn: String

        @inlinable
        public init(arn: String) {
            self.arn = arn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.arn, key: "arn")
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 76)
            try self.validate(self.arn, name: "arn", parent: name, min: 46)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// A list of tags associated with the given pipeline.
        public let tags: [Tag]?

        @inlinable
        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct LogPublishingOptions: AWSEncodableShape & AWSDecodableShape {
        /// The destination for OpenSearch Ingestion logs sent to Amazon CloudWatch Logs. This parameter is required if IsLoggingEnabled is set to true.
        public let cloudWatchLogDestination: CloudWatchLogDestination?
        /// Whether logs should be published.
        public let isLoggingEnabled: Bool?

        @inlinable
        public init(cloudWatchLogDestination: CloudWatchLogDestination? = nil, isLoggingEnabled: Bool? = nil) {
            self.cloudWatchLogDestination = cloudWatchLogDestination
            self.isLoggingEnabled = isLoggingEnabled
        }

        public func validate(name: String) throws {
            try self.cloudWatchLogDestination?.validate(name: "\(name).cloudWatchLogDestination")
        }

        private enum CodingKeys: String, CodingKey {
            case cloudWatchLogDestination = "CloudWatchLogDestination"
            case isLoggingEnabled = "IsLoggingEnabled"
        }
    }

    public struct Pipeline: AWSDecodableShape {
        public let bufferOptions: BufferOptions?
        /// The date and time when the pipeline was created.
        public let createdAt: Date?
        /// Destinations to which the pipeline writes data.
        public let destinations: [PipelineDestination]?
        public let encryptionAtRestOptions: EncryptionAtRestOptions?
        /// The ingestion endpoints for the pipeline, which you can send data to.
        public let ingestEndpointUrls: [String]?
        /// The date and time when the pipeline was last updated.
        public let lastUpdatedAt: Date?
        /// Key-value pairs that represent log publishing settings.
        public let logPublishingOptions: LogPublishingOptions?
        /// The maximum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let maxUnits: Int?
        /// The minimum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let minUnits: Int?
        /// The Amazon Resource Name (ARN) of the pipeline.
        public let pipelineArn: String?
        /// The Data Prepper pipeline configuration in YAML format.
        public let pipelineConfigurationBody: String?
        /// The name of the pipeline.
        public let pipelineName: String?
        /// The Amazon Resource Name (ARN) of the IAM role that the pipeline uses to access AWS resources.
        public let pipelineRoleArn: String?
        /// A list of VPC endpoints that OpenSearch Ingestion has created to other Amazon Web Services services.
        public let serviceVpcEndpoints: [ServiceVpcEndpoint]?
        /// The current status of the pipeline.
        public let status: PipelineStatus?
        /// The reason for the current status of the pipeline.
        public let statusReason: PipelineStatusReason?
        /// A list of tags associated with the given pipeline.
        public let tags: [Tag]?
        /// The VPC interface endpoints that have access to the pipeline.
        public let vpcEndpoints: [VpcEndpoint]?
        /// The VPC endpoint service name for the pipeline.
        public let vpcEndpointService: String?

        @inlinable
        public init(bufferOptions: BufferOptions? = nil, createdAt: Date? = nil, destinations: [PipelineDestination]? = nil, encryptionAtRestOptions: EncryptionAtRestOptions? = nil, ingestEndpointUrls: [String]? = nil, lastUpdatedAt: Date? = nil, logPublishingOptions: LogPublishingOptions? = nil, maxUnits: Int? = nil, minUnits: Int? = nil, pipelineArn: String? = nil, pipelineConfigurationBody: String? = nil, pipelineName: String? = nil, pipelineRoleArn: String? = nil, serviceVpcEndpoints: [ServiceVpcEndpoint]? = nil, status: PipelineStatus? = nil, statusReason: PipelineStatusReason? = nil, tags: [Tag]? = nil, vpcEndpoints: [VpcEndpoint]? = nil, vpcEndpointService: String? = nil) {
            self.bufferOptions = bufferOptions
            self.createdAt = createdAt
            self.destinations = destinations
            self.encryptionAtRestOptions = encryptionAtRestOptions
            self.ingestEndpointUrls = ingestEndpointUrls
            self.lastUpdatedAt = lastUpdatedAt
            self.logPublishingOptions = logPublishingOptions
            self.maxUnits = maxUnits
            self.minUnits = minUnits
            self.pipelineArn = pipelineArn
            self.pipelineConfigurationBody = pipelineConfigurationBody
            self.pipelineName = pipelineName
            self.pipelineRoleArn = pipelineRoleArn
            self.serviceVpcEndpoints = serviceVpcEndpoints
            self.status = status
            self.statusReason = statusReason
            self.tags = tags
            self.vpcEndpoints = vpcEndpoints
            self.vpcEndpointService = vpcEndpointService
        }

        private enum CodingKeys: String, CodingKey {
            case bufferOptions = "BufferOptions"
            case createdAt = "CreatedAt"
            case destinations = "Destinations"
            case encryptionAtRestOptions = "EncryptionAtRestOptions"
            case ingestEndpointUrls = "IngestEndpointUrls"
            case lastUpdatedAt = "LastUpdatedAt"
            case logPublishingOptions = "LogPublishingOptions"
            case maxUnits = "MaxUnits"
            case minUnits = "MinUnits"
            case pipelineArn = "PipelineArn"
            case pipelineConfigurationBody = "PipelineConfigurationBody"
            case pipelineName = "PipelineName"
            case pipelineRoleArn = "PipelineRoleArn"
            case serviceVpcEndpoints = "ServiceVpcEndpoints"
            case status = "Status"
            case statusReason = "StatusReason"
            case tags = "Tags"
            case vpcEndpoints = "VpcEndpoints"
            case vpcEndpointService = "VpcEndpointService"
        }
    }

    public struct PipelineBlueprint: AWSDecodableShape {
        /// The name of the blueprint.
        public let blueprintName: String?
        /// A description of the blueprint.
        public let displayDescription: String?
        /// The display name of the blueprint.
        public let displayName: String?
        /// The YAML configuration of the blueprint.
        public let pipelineConfigurationBody: String?
        /// The name of the service that the blueprint is associated with.
        public let service: String?
        /// The use case that the blueprint relates to.
        public let useCase: String?

        @inlinable
        public init(blueprintName: String? = nil, displayDescription: String? = nil, displayName: String? = nil, pipelineConfigurationBody: String? = nil, service: String? = nil, useCase: String? = nil) {
            self.blueprintName = blueprintName
            self.displayDescription = displayDescription
            self.displayName = displayName
            self.pipelineConfigurationBody = pipelineConfigurationBody
            self.service = service
            self.useCase = useCase
        }

        private enum CodingKeys: String, CodingKey {
            case blueprintName = "BlueprintName"
            case displayDescription = "DisplayDescription"
            case displayName = "DisplayName"
            case pipelineConfigurationBody = "PipelineConfigurationBody"
            case service = "Service"
            case useCase = "UseCase"
        }
    }

    public struct PipelineBlueprintSummary: AWSDecodableShape {
        /// The name of the blueprint.
        public let blueprintName: String?
        /// A description of the blueprint.
        public let displayDescription: String?
        /// The display name of the blueprint.
        public let displayName: String?
        /// The name of the service that the blueprint is associated with.
        public let service: String?
        /// The use case that the blueprint relates to.
        public let useCase: String?

        @inlinable
        public init(blueprintName: String? = nil, displayDescription: String? = nil, displayName: String? = nil, service: String? = nil, useCase: String? = nil) {
            self.blueprintName = blueprintName
            self.displayDescription = displayDescription
            self.displayName = displayName
            self.service = service
            self.useCase = useCase
        }

        private enum CodingKeys: String, CodingKey {
            case blueprintName = "BlueprintName"
            case displayDescription = "DisplayDescription"
            case displayName = "DisplayName"
            case service = "Service"
            case useCase = "UseCase"
        }
    }

    public struct PipelineDestination: AWSDecodableShape {
        /// The endpoint receiving data from the pipeline.
        public let endpoint: String?
        /// The name of the service receiving data from the pipeline.
        public let serviceName: String?

        @inlinable
        public init(endpoint: String? = nil, serviceName: String? = nil) {
            self.endpoint = endpoint
            self.serviceName = serviceName
        }

        private enum CodingKeys: String, CodingKey {
            case endpoint = "Endpoint"
            case serviceName = "ServiceName"
        }
    }

    public struct PipelineEndpoint: AWSDecodableShape {
        /// The unique identifier for the pipeline endpoint.
        public let endpointId: String?
        /// The URL used to ingest data to the pipeline through the VPC endpoint.
        public let ingestEndpointUrl: String?
        /// The Amazon Resource Name (ARN) of the pipeline associated with this endpoint.
        public let pipelineArn: String?
        /// The current status of the pipeline endpoint.
        public let status: PipelineEndpointStatus?
        /// The ID of the VPC where the pipeline endpoint is created.
        public let vpcId: String?
        /// Configuration options for the VPC endpoint, including subnet and security group settings.
        public let vpcOptions: PipelineEndpointVpcOptions?

        @inlinable
        public init(endpointId: String? = nil, ingestEndpointUrl: String? = nil, pipelineArn: String? = nil, status: PipelineEndpointStatus? = nil, vpcId: String? = nil, vpcOptions: PipelineEndpointVpcOptions? = nil) {
            self.endpointId = endpointId
            self.ingestEndpointUrl = ingestEndpointUrl
            self.pipelineArn = pipelineArn
            self.status = status
            self.vpcId = vpcId
            self.vpcOptions = vpcOptions
        }

        private enum CodingKeys: String, CodingKey {
            case endpointId = "EndpointId"
            case ingestEndpointUrl = "IngestEndpointUrl"
            case pipelineArn = "PipelineArn"
            case status = "Status"
            case vpcId = "VpcId"
            case vpcOptions = "VpcOptions"
        }
    }

    public struct PipelineEndpointConnection: AWSDecodableShape {
        /// The unique identifier of the endpoint in the connection.
        public let endpointId: String?
        /// The Amazon Resource Name (ARN) of the pipeline in the endpoint connection.
        public let pipelineArn: String?
        /// The current status of the pipeline endpoint connection.
        public let status: PipelineEndpointStatus?
        /// The Amazon Web Services account ID that owns the VPC endpoint used in this connection.
        public let vpcEndpointOwner: String?

        @inlinable
        public init(endpointId: String? = nil, pipelineArn: String? = nil, status: PipelineEndpointStatus? = nil, vpcEndpointOwner: String? = nil) {
            self.endpointId = endpointId
            self.pipelineArn = pipelineArn
            self.status = status
            self.vpcEndpointOwner = vpcEndpointOwner
        }

        private enum CodingKeys: String, CodingKey {
            case endpointId = "EndpointId"
            case pipelineArn = "PipelineArn"
            case status = "Status"
            case vpcEndpointOwner = "VpcEndpointOwner"
        }
    }

    public struct PipelineEndpointVpcOptions: AWSEncodableShape & AWSDecodableShape {
        /// A list of security group IDs that control network access to the pipeline endpoint.
        public let securityGroupIds: [String]?
        /// A list of subnet IDs where the pipeline endpoint network interfaces are created.
        public let subnetIds: [String]?

        @inlinable
        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.securityGroupIds?.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, max: 20)
                try validate($0, name: "securityGroupIds[]", parent: name, min: 11)
                try validate($0, name: "securityGroupIds[]", parent: name, pattern: "^sg-\\w{8}(\\w{9})?$")
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 12)
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, min: 1)
            try self.subnetIds?.forEach {
                try validate($0, name: "subnetIds[]", parent: name, max: 24)
                try validate($0, name: "subnetIds[]", parent: name, min: 15)
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^subnet-\\w{8}(\\w{9})?$")
            }
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 12)
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
        }
    }

    public struct PipelineStatusReason: AWSDecodableShape {
        /// A description of why a pipeline has a certain status.
        public let description: String?

        @inlinable
        public init(description: String? = nil) {
            self.description = description
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
        }
    }

    public struct PipelineSummary: AWSDecodableShape {
        /// The date and time when the pipeline was created.
        public let createdAt: Date?
        /// A list of destinations to which the pipeline writes data.
        public let destinations: [PipelineDestination]?
        /// The date and time when the pipeline was last updated.
        public let lastUpdatedAt: Date?
        /// The maximum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let maxUnits: Int?
        /// The minimum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let minUnits: Int?
        /// The Amazon Resource Name (ARN) of the pipeline.
        public let pipelineArn: String?
        /// The name of the pipeline.
        public let pipelineName: String?
        /// The current status of the pipeline.
        public let status: PipelineStatus?
        public let statusReason: PipelineStatusReason?
        /// A list of tags associated with the given pipeline.
        public let tags: [Tag]?

        @inlinable
        public init(createdAt: Date? = nil, destinations: [PipelineDestination]? = nil, lastUpdatedAt: Date? = nil, maxUnits: Int? = nil, minUnits: Int? = nil, pipelineArn: String? = nil, pipelineName: String? = nil, status: PipelineStatus? = nil, statusReason: PipelineStatusReason? = nil, tags: [Tag]? = nil) {
            self.createdAt = createdAt
            self.destinations = destinations
            self.lastUpdatedAt = lastUpdatedAt
            self.maxUnits = maxUnits
            self.minUnits = minUnits
            self.pipelineArn = pipelineArn
            self.pipelineName = pipelineName
            self.status = status
            self.statusReason = statusReason
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case destinations = "Destinations"
            case lastUpdatedAt = "LastUpdatedAt"
            case maxUnits = "MaxUnits"
            case minUnits = "MinUnits"
            case pipelineArn = "PipelineArn"
            case pipelineName = "PipelineName"
            case status = "Status"
            case statusReason = "StatusReason"
            case tags = "Tags"
        }
    }

    public struct PutResourcePolicyRequest: AWSEncodableShape {
        /// The resource-based policy document in JSON format.
        public let policy: String
        /// The Amazon Resource Name (ARN) of the resource to attach the policy to.
        public let resourceArn: String

        @inlinable
        public init(policy: String, resourceArn: String) {
            self.policy = policy
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encode(self.policy, forKey: .policy)
            request.encodePath(self.resourceArn, key: "ResourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.policy, name: "policy", parent: name, max: 204800)
            try self.validate(self.policy, name: "policy", parent: name, min: 2)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 76)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 46)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case policy = "Policy"
        }
    }

    public struct PutResourcePolicyResponse: AWSDecodableShape {
        /// The resource-based policy document that was attached to the resource.
        public let policy: String?
        /// The Amazon Resource Name (ARN) of the resource.
        public let resourceArn: String?

        @inlinable
        public init(policy: String? = nil, resourceArn: String? = nil) {
            self.policy = policy
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case policy = "Policy"
            case resourceArn = "ResourceArn"
        }
    }

    public struct RevokePipelineEndpointConnectionsRequest: AWSEncodableShape {
        /// A list of endpoint IDs for which to revoke access to the pipeline.
        public let endpointIds: [String]
        /// The Amazon Resource Name (ARN) of the pipeline from which to revoke endpoint connections.
        public let pipelineArn: String

        @inlinable
        public init(endpointIds: [String], pipelineArn: String) {
            self.endpointIds = endpointIds
            self.pipelineArn = pipelineArn
        }

        public func validate(name: String) throws {
            try self.endpointIds.forEach {
                try validate($0, name: "endpointIds[]", parent: name, max: 512)
                try validate($0, name: "endpointIds[]", parent: name, min: 3)
                try validate($0, name: "endpointIds[]", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9-_]+$")
            }
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, max: 76)
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, min: 46)
            try self.validate(self.pipelineArn, name: "pipelineArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case endpointIds = "EndpointIds"
            case pipelineArn = "PipelineArn"
        }
    }

    public struct RevokePipelineEndpointConnectionsResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the pipeline from which endpoint connections were revoked.
        public let pipelineArn: String?

        @inlinable
        public init(pipelineArn: String? = nil) {
            self.pipelineArn = pipelineArn
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineArn = "PipelineArn"
        }
    }

    public struct ServiceVpcEndpoint: AWSDecodableShape {
        /// The name of the service for which a VPC endpoint was created.
        public let serviceName: VpcEndpointServiceName?
        /// The unique identifier of the VPC endpoint that was created.
        public let vpcEndpointId: String?

        @inlinable
        public init(serviceName: VpcEndpointServiceName? = nil, vpcEndpointId: String? = nil) {
            self.serviceName = serviceName
            self.vpcEndpointId = vpcEndpointId
        }

        private enum CodingKeys: String, CodingKey {
            case serviceName = "ServiceName"
            case vpcEndpointId = "VpcEndpointId"
        }
    }

    public struct StartPipelineRequest: AWSEncodableShape {
        /// The name of the pipeline to start.
        public let pipelineName: String

        @inlinable
        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.pipelineName, key: "PipelineName")
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StartPipelineResponse: AWSDecodableShape {
        public let pipeline: Pipeline?

        @inlinable
        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline = "Pipeline"
        }
    }

    public struct StopPipelineRequest: AWSEncodableShape {
        /// The name of the pipeline to stop.
        public let pipelineName: String

        @inlinable
        public init(pipelineName: String) {
            self.pipelineName = pipelineName
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.pipelineName, key: "PipelineName")
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StopPipelineResponse: AWSDecodableShape {
        public let pipeline: Pipeline?

        @inlinable
        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline = "Pipeline"
        }
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// The tag key. Tag keys must be unique for the pipeline to which they are attached.
        public let key: String
        /// The value assigned to the corresponding tag key. Tag values can be null and don't have to be unique in a tag set. For example, you can have a key value pair in a tag set of project : Trinity and cost-center : Trinity
        public let value: String

        @inlinable
        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: ".*")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, pattern: ".*")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pipeline to tag.
        public let arn: String
        /// The list of key-value tags to add to the pipeline.
        public let tags: [Tag]

        @inlinable
        public init(arn: String, tags: [Tag]) {
            self.arn = arn
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.arn, key: "arn")
            try container.encode(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 76)
            try self.validate(self.arn, name: "arn", parent: name, min: 46)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the pipeline to remove tags from.
        public let arn: String
        /// The tag keys to remove.
        public let tagKeys: [String]

        @inlinable
        public init(arn: String, tagKeys: [String]) {
            self.arn = arn
            self.tagKeys = tagKeys
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.arn, key: "arn")
            try container.encode(self.tagKeys, forKey: .tagKeys)
        }

        public func validate(name: String) throws {
            try self.validate(self.arn, name: "arn", parent: name, max: 76)
            try self.validate(self.arn, name: "arn", parent: name, min: 46)
            try self.validate(self.arn, name: "arn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b):osis:.+:pipeline\\/.+$")
        }

        private enum CodingKeys: String, CodingKey {
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdatePipelineRequest: AWSEncodableShape {
        /// Key-value pairs to configure persistent buffering for the pipeline.
        public let bufferOptions: BufferOptions?
        /// Key-value pairs to configure encryption for data that is written to a persistent buffer.
        public let encryptionAtRestOptions: EncryptionAtRestOptions?
        /// Key-value pairs to configure log publishing.
        public let logPublishingOptions: LogPublishingOptions?
        /// The maximum pipeline capacity, in Ingestion Compute Units (ICUs)
        public let maxUnits: Int?
        /// The minimum pipeline capacity, in Ingestion Compute Units (ICUs).
        public let minUnits: Int?
        /// The pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with \n.
        public let pipelineConfigurationBody: String?
        /// The name of the pipeline to update.
        public let pipelineName: String
        /// The Amazon Resource Name (ARN) of the IAM role that grants the pipeline permission to access Amazon Web Services resources.
        public let pipelineRoleArn: String?

        @inlinable
        public init(bufferOptions: BufferOptions? = nil, encryptionAtRestOptions: EncryptionAtRestOptions? = nil, logPublishingOptions: LogPublishingOptions? = nil, maxUnits: Int? = nil, minUnits: Int? = nil, pipelineConfigurationBody: String? = nil, pipelineName: String, pipelineRoleArn: String? = nil) {
            self.bufferOptions = bufferOptions
            self.encryptionAtRestOptions = encryptionAtRestOptions
            self.logPublishingOptions = logPublishingOptions
            self.maxUnits = maxUnits
            self.minUnits = minUnits
            self.pipelineConfigurationBody = pipelineConfigurationBody
            self.pipelineName = pipelineName
            self.pipelineRoleArn = pipelineRoleArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            try container.encodeIfPresent(self.bufferOptions, forKey: .bufferOptions)
            try container.encodeIfPresent(self.encryptionAtRestOptions, forKey: .encryptionAtRestOptions)
            try container.encodeIfPresent(self.logPublishingOptions, forKey: .logPublishingOptions)
            try container.encodeIfPresent(self.maxUnits, forKey: .maxUnits)
            try container.encodeIfPresent(self.minUnits, forKey: .minUnits)
            try container.encodeIfPresent(self.pipelineConfigurationBody, forKey: .pipelineConfigurationBody)
            request.encodePath(self.pipelineName, key: "PipelineName")
            try container.encodeIfPresent(self.pipelineRoleArn, forKey: .pipelineRoleArn)
        }

        public func validate(name: String) throws {
            try self.encryptionAtRestOptions?.validate(name: "\(name).encryptionAtRestOptions")
            try self.logPublishingOptions?.validate(name: "\(name).logPublishingOptions")
            try self.validate(self.maxUnits, name: "maxUnits", parent: name, min: 1)
            try self.validate(self.minUnits, name: "minUnits", parent: name, min: 1)
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, max: 24000)
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, min: 1)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, max: 28)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, min: 3)
            try self.validate(self.pipelineName, name: "pipelineName", parent: name, pattern: "^[a-z][a-z0-9\\-]+$")
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, max: 2048)
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, min: 20)
            try self.validate(self.pipelineRoleArn, name: "pipelineRoleArn", parent: name, pattern: "^arn:(aws|aws\\-cn|aws\\-us\\-gov|aws\\-iso|aws\\-iso\\-b|aws\\-iso\\-e|aws\\-iso\\-f):iam::[0-9]+:role\\/.*$")
        }

        private enum CodingKeys: String, CodingKey {
            case bufferOptions = "BufferOptions"
            case encryptionAtRestOptions = "EncryptionAtRestOptions"
            case logPublishingOptions = "LogPublishingOptions"
            case maxUnits = "MaxUnits"
            case minUnits = "MinUnits"
            case pipelineConfigurationBody = "PipelineConfigurationBody"
            case pipelineRoleArn = "PipelineRoleArn"
        }
    }

    public struct UpdatePipelineResponse: AWSDecodableShape {
        /// Container for information about the updated pipeline.
        public let pipeline: Pipeline?

        @inlinable
        public init(pipeline: Pipeline? = nil) {
            self.pipeline = pipeline
        }

        private enum CodingKeys: String, CodingKey {
            case pipeline = "Pipeline"
        }
    }

    public struct ValidatePipelineRequest: AWSEncodableShape {
        /// The pipeline configuration in YAML format. The command accepts the pipeline configuration as a string or within a .yaml file. If you provide the configuration as a string, each new line must be escaped with \n.
        public let pipelineConfigurationBody: String

        @inlinable
        public init(pipelineConfigurationBody: String) {
            self.pipelineConfigurationBody = pipelineConfigurationBody
        }

        public func validate(name: String) throws {
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, max: 24000)
            try self.validate(self.pipelineConfigurationBody, name: "pipelineConfigurationBody", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case pipelineConfigurationBody = "PipelineConfigurationBody"
        }
    }

    public struct ValidatePipelineResponse: AWSDecodableShape {
        /// A list of errors if the configuration is invalid.
        public let errors: [ValidationMessage]?
        /// A boolean indicating whether or not the pipeline configuration is valid.
        public let isValid: Bool?

        @inlinable
        public init(errors: [ValidationMessage]? = nil, isValid: Bool? = nil) {
            self.errors = errors
            self.isValid = isValid
        }

        private enum CodingKeys: String, CodingKey {
            case errors = "Errors"
            case isValid = "isValid"
        }
    }

    public struct ValidationMessage: AWSDecodableShape {
        /// The validation message.
        public let message: String?

        @inlinable
        public init(message: String? = nil) {
            self.message = message
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
        }
    }

    public struct VpcAttachmentOptions: AWSEncodableShape & AWSDecodableShape {
        /// Whether a VPC is attached to the pipeline.
        public let attachToVpc: Bool
        /// The CIDR block to be reserved for OpenSearch Ingestion to create elastic network interfaces (ENIs).
        public let cidrBlock: String?

        @inlinable
        public init(attachToVpc: Bool, cidrBlock: String? = nil) {
            self.attachToVpc = attachToVpc
            self.cidrBlock = cidrBlock
        }

        public func validate(name: String) throws {
            try self.validate(self.cidrBlock, name: "cidrBlock", parent: name, pattern: "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/(3[0-2]|[12]?[0-9])$")
        }

        private enum CodingKeys: String, CodingKey {
            case attachToVpc = "AttachToVpc"
            case cidrBlock = "CidrBlock"
        }
    }

    public struct VpcEndpoint: AWSDecodableShape {
        /// The unique identifier of the endpoint.
        public let vpcEndpointId: String?
        /// The ID for your VPC. Amazon Web Services PrivateLink generates this value when you create a VPC.
        public let vpcId: String?
        /// Information about the VPC, including associated subnets and security groups.
        public let vpcOptions: VpcOptions?

        @inlinable
        public init(vpcEndpointId: String? = nil, vpcId: String? = nil, vpcOptions: VpcOptions? = nil) {
            self.vpcEndpointId = vpcEndpointId
            self.vpcId = vpcId
            self.vpcOptions = vpcOptions
        }

        private enum CodingKeys: String, CodingKey {
            case vpcEndpointId = "VpcEndpointId"
            case vpcId = "VpcId"
            case vpcOptions = "VpcOptions"
        }
    }

    public struct VpcOptions: AWSEncodableShape & AWSDecodableShape {
        /// A list of security groups associated with the VPC endpoint.
        public let securityGroupIds: [String]?
        /// A list of subnet IDs associated with the VPC endpoint.
        public let subnetIds: [String]
        /// Options for attaching a VPC to a pipeline.
        public let vpcAttachmentOptions: VpcAttachmentOptions?
        /// Defines whether you or Amazon OpenSearch Ingestion service create and manage the VPC endpoint configured for the pipeline.
        public let vpcEndpointManagement: VpcEndpointManagement?

        @inlinable
        public init(securityGroupIds: [String]? = nil, subnetIds: [String], vpcAttachmentOptions: VpcAttachmentOptions? = nil, vpcEndpointManagement: VpcEndpointManagement? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
            self.vpcAttachmentOptions = vpcAttachmentOptions
            self.vpcEndpointManagement = vpcEndpointManagement
        }

        public func validate(name: String) throws {
            try self.securityGroupIds?.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, max: 20)
                try validate($0, name: "securityGroupIds[]", parent: name, min: 11)
                try validate($0, name: "securityGroupIds[]", parent: name, pattern: "^sg-\\w{8}(\\w{9})?$")
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 12)
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, min: 1)
            try self.subnetIds.forEach {
                try validate($0, name: "subnetIds[]", parent: name, max: 24)
                try validate($0, name: "subnetIds[]", parent: name, min: 15)
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^subnet-\\w{8}(\\w{9})?$")
            }
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 12)
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, min: 1)
            try self.vpcAttachmentOptions?.validate(name: "\(name).vpcAttachmentOptions")
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "SecurityGroupIds"
            case subnetIds = "SubnetIds"
            case vpcAttachmentOptions = "VpcAttachmentOptions"
            case vpcEndpointManagement = "VpcEndpointManagement"
        }
    }
}

// MARK: - Errors

/// Error enum for OSIS
public struct OSISErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case disabledOperationException = "DisabledOperationException"
        case internalException = "InternalException"
        case invalidPaginationTokenException = "InvalidPaginationTokenException"
        case limitExceededException = "LimitExceededException"
        case resourceAlreadyExistsException = "ResourceAlreadyExistsException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize OSIS
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You don't have permissions to access the resource.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// The client attempted to remove a resource that is currently in use.
    public static var conflictException: Self { .init(.conflictException) }
    /// Exception is thrown when an operation has been disabled.
    public static var disabledOperationException: Self { .init(.disabledOperationException) }
    /// The request failed because of an unknown error, exception, or failure (the failure is internal to the service).
    public static var internalException: Self { .init(.internalException) }
    /// An invalid pagination token provided in the request.
    public static var invalidPaginationTokenException: Self { .init(.invalidPaginationTokenException) }
    /// You attempted to create more than the allowed number of tags.
    public static var limitExceededException: Self { .init(.limitExceededException) }
    /// You attempted to create a resource that already exists.
    public static var resourceAlreadyExistsException: Self { .init(.resourceAlreadyExistsException) }
    /// You attempted to access or delete a resource that does not exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// An exception for missing or invalid input fields.
    public static var validationException: Self { .init(.validationException) }
}

extension OSISErrorType: Equatable {
    public static func == (lhs: OSISErrorType, rhs: OSISErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension OSISErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
